import request from '@/utils/request'

/**
 * 添加下级
 * @param data
 */
export function createUser(data) {
  return request({
    url: '/api/user/createUser',
    method: 'post',
    data: data
  })
}

/**
 * 编辑信息
 * @param data
 */
export function updateUser(data) {
  return request({
    url: '/api/user/updateUser',
    method: 'post',
    data: data
  })
}


//登录用户信息
export function loginInfo(query) {
  return request({
    url: '/api/user/loginInfo',
    method: 'get',
    params: query
  })
}

//修改密码
export function updatePassword(data) {
  return request({
    url: '/api/user/updatePassword',
    method: 'post',
    data: data
  })
}

//修改下级收益比例
export function updateIncomeScale(data) {
  return request({
    url: '/api/user/updateIncomeScale',
    method: 'post',
    data: data
  })
}

//下级所有代理商
export function lowerUserList(query) {
  return request({
    url: '/api/user/lowerUserList',
    method: 'get',
    params: query
  })
}


//注册用户统计概览
export function userProbably() {
  return request({
    url: '/api/regUser/userProbably',
    method: 'get'
  })
}

//注册用户统计
export function userStatistics(query) {
  return request({
    url: '/api/regUser/statistics',
    method: 'get',
    params: query
  })
}

//充值统计
export function payStatistics(query) {
  return request({
    url: '/api/payUser/statistics',
    method: 'get',
    params: query
  })
}

//收益统计
export function incomeStatistics(query) {
  return request({
    url: '/api/income/statistics',
    method: 'get',
    params: query
  })
}

//下属详情统计
export function detailsStatistics(query) {
  return request({
    url: '/api/user/detailsStatistics',
    method: 'get',
    params: query
  })
}

